from time import sleep

from page.focus_project_page import FocusProjectPage
import random as r
from page.common_tools import CommonTools


class FocusDiscussPage(FocusProjectPage, CommonTools):

    def publish_discuss(self):
        self.find_button('发布').click()
        self.find_static_text(string='请输入标题', contains_flag=1).click()
        self.find_static_text(string='请输入标题', contains_flag=1).send_keys("App面授研讨自动化测试%d" % r.randint(100, 999))
        # self.find_static_text('请选择').click()
        # self.find_static_text('培训项目').click()
        # self.find_static_text(string="确定", contains_flag=1).click()
        self.find_static_text(string="请输入描述",contains_flag=1).click()
        self.find_static_text(string="请输入描述",contains_flag=1).send_keys("这是研讨的描述。是大家上几艘船敌手hi从未画册我欧委会物理 互动四比我爸黑恶我阿UI我笔误吧不催我看无IQ蛔虫病把我我班次哈哈哈哈哈哈哈哈哈哈。。。。")
        self.hide_keyboard()
        self.find_button("确认").click()
        sleep(2)
        self.find_button(string="common back dark icon", contains_flag=1).click()
        self.find_button(string="数学班", contains_flag=1).click()

if __name__ == "__main__":
    test = FocusDiscussPage()
    test.enter_project()
    test.enter_tools("研讨")
    test.publish_discuss()
